<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>资源管理</title>
<script type="text/javascript">
<!--
	var myEditUrl = '${pageContext.request.contextPath}/backend/system/userManager/show/';
	var myAddUrl	= '${pageContext.request.contextPath}/backend/system/userManager/add';
	var mySaveUrl	= '${pageContext.request.contextPath}/backend/system/userManager/save';
	var mydeleteUrl	= '${pageContext.request.contextPath}/backend/system/userManager/disable/';
	//var myUploadUrl	= '${pageContext.request.contextPath}/backend/system/menuPackage/upload';
	var myEditDivHeight = 390;

		/** 编辑时赋值输入框 **/
	function fillDIV(data){
		$("#dealid").val(data.id);
		<c:forEach items="${beans}" var="o">
			$("#deal${o.fieldId}").val(data.${o.field});
		</c:forEach>	
		$("#type").val(data.type);
		//$("#status").val(data.status);
		

		$("input[name='auths']").removeAttr("checked"); //'alert(data.auths);
		var roles = document.getElementsByName("auths");
		for (var j=0; j<roles.length; j++)
		{
			var inside = false;
			var role = roles[j].value;//$(this).attr("value");
			for (var i=0; i<data.auths.length;i++ )
			{
				if (data.auths[i]==role)
				{
					inside = true;break;
				}
			}				
			if (inside) {
				roles[j].checked = true;
				//$(this).attr("checked",true); 					
			}else{
				roles[j].checked = false;
				//$(this).removeAttr("checked"); 
			}

		}
			//$("input[name='roleArr']").each(
			//function(){ 
				
			//}
		//)
	}

	function doValid(){
		return true;
	}	
//-->
</script>
</head>
<body>
	<!-- 标题 -->
	<div class="titleBar m_b_20">
		<div class="tit fl b_l_e74a5f">
			<h3 class="cn">管理员管理</h3>
			<span class="en">manager information</span>
		</div>
		<div class="fr"></div>
	</div>
	<!-- end 标题 -->

	<form method="post" action="${pageContext.request.contextPath }/backend/system/userManager/search" name="searchForm"  >
  	<input type="hidden" name="pageNo" value="${dto.pageNo}">
  	<input type="hidden" name="totalCount" value="${dto.totalCount}">
				<!-- 查询 -->
			                <div class="box_03 p_20 m_b_20">
			                	<table class="tb_style02" width="100%">
	                				<tr>
	                					<th>姓名</th>
	                					<td><input name="name" value="${dto.name}" style="width:200px;" class="input_style2" type="text" placeholder=""></td>
	                					<th>账号</th>
	                					<td><input name="account" value="${dto.account}" style="width:200px;" class="input_style2" type="text" placeholder=""></td>
	      
	                				</tr>
	                			
	                				<tr>
	                					<th>每页显示</th>
	                					<td colspan="5">
	                						<input style="width:50px;" class="input_style2" type="text" placeholder="" id="pageSize" name="pageSize" value="${dto.pageSize}"> 条
	                						<span style="margin-left:170px;">
	                							<input style="width:110px;" class="btn_brown02 m_r_12" type="button" name="searchData" id="searchData" value="查  询">
	                							<input style="width:110px;" class="btn_brown02 m_r_12" type="button" name="addData" id="addData" value="添 加">
	                						</span>
	                					</td>
	                				</tr>
		                		</table>
			                </div>
			                <!-- end 查询 -->
				
</form>
<%
boolean incDisplayTable = true;
boolean incEditTable = false;
boolean incUploadDiv = true;
boolean incBatchDelete = false;
boolean incDisplayStatus =  true;
String uploadTmp="resources.xls";
%>

<!-- 添加start -->
<div class="editDataDiv" id="editDIV" title="${pageTitle}" style="display: none;" >
	<center>
	<form action="#" id="editFm" method="post" name="editFm" class="editFm"><input type="hidden" name="id" id="dealid" value=0>
		<table >
			<c:forEach items="${beans}" var="o">
			<tr>
 				<td width="25%" align="right"> 
 					<label>${o.title}：</label>  
 				</td>
				<td> 
					<input type="text" name="${o.field}" id="deal${o.fieldId}" style="width:200px" <c:if test="${o.maxlength>0}">maxlength="${o.maxlength}"</c:if>/> 
					<c:if test="${!o.nullable}"><font color="red">*</font></c:if>
				</td>
  			</tr>
			</c:forEach>


		  <tr>
			<td width="25%" align="right"> <label>权限 :</label> </td>
			<td ><c:forEach items="${roleLists}" var="roleVar" varStatus="roleStatus">
									<input type="checkbox" name="auths" value="${roleVar.id}">${roleVar.name}&nbsp;
							 </c:forEach>
			 </td>			   
		  </tr>
			<tr>
      			<td colspan="2">
          			<p class="validateTips_deal" align="center"></p>
      			</td>
    		</tr>
		</table>
	</form>
	</center>
</div>
<!-- 添加end -->
<%@ include file="/WEB-INF/page/backend/common/inc_edit_page.jsp" %>	
<%@ include file="/WEB-INF/page/backend/common/inc_edit_js.jsp" %>

</body>
</html>